package buttons;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import controller.TurtleController;

public class DirectionButton
{
    JButton myButton;
    TextInput myText;
    TurtleController myController;
    int myRightScroll;
    int myUpScroll;

    public DirectionButton(String name, TurtleController controller, int right,
            int up)
    {
        myButton = new JButton(name);
        myController = controller;
        myRightScroll = right;
        myUpScroll = up;

        myButton.addActionListener(new ActionListener()
        {
            @Override
            public void actionPerformed(ActionEvent e)
            {
                myController.moveCamera(myRightScroll, myUpScroll);
            }
        });
    }

    public JButton getInstance()
    {
        return myButton;
    }
}